t = input("What is the temperature?")

try:
    if t[-1] in ["F"]:
        T = int((eval(t[0:-1]) - 32)/1.8)
        print(f"The converted temperature is {str(T)}C")
    elif t[-1] in ["C"]:
        T = int(eval(t[0:-1]) * 1.8 + 32)
        print(f"The converted temperature is {str(T)}F")
    else:
        print("End with 'C','c','F','f'")
except NameError:
    print("Input error")
